var pageii = null;
var grid = null;
$(function() {

	grid = lyGrid({
		pagId : 'paging',
		l_column : [ {
			colkey : "checkDate",
			name : "检查日期"
		}, {
			colkey : "machineId",
			name : "机台号"
		}, {
			colkey : "",
			name : "拆模具号？？？"
		}, {
			colkey : "sortName",
			name : "类别"
		}],
		jsonUrl : rootPath + '/pUnloadcheck/pUnload_findByPage.shtml',
		dymCol:true,
		checkbox : true,
		serNumber : false
	});
	$("#editFun").click("click", function() {
		editAccount();
	});
	$("#search").click("click", function() {// 绑定查询按扭
		
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});
	
});
function editAccount() {
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1 || cbox == "") {
		layer.msg("只能选中一个");
		return;
	}
	pageii = layer.open({
		title : "编辑卸模前模具质量检查表",
		type : 2,
		area : [ "1200px", "100%" ],
		content : rootPath + '/pUnloadcheck/pUnloadCheck_edit.shtml?id=' + cbox
	});
}
